import 'package:flutter/material.dart';
import 'package:flutter_baselib/lib.dart';
import 'package:flutter_baselib_example/home_page.dart';

void main() {
  BaseLibPlugin.postCatchException(
    () => runApp(App()),
    onUploadCallback: (String errMsg, errDetail) {
      ///上传日志到bugly时，回调该方法
      LogUtils.e('bugly捕获异常msg', errMsg);
      LogUtils.e('bugly捕获异常detail', errDetail);

      ToastUtils.show('发生异常了');
    },
  );
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
      builder: BaseLibPlugin.oneContextBuilder,
      navigatorKey: BaseLibPlugin.oneContextKey,
    );
  }
}
